#include<iostream>
using namespace std;

template<unsigned long N>
struct binary
{
	static_assert(N % 10 < 2, "binary literal invalid!!!"); 
	static const unsigned long value = binary<N/10>::value * 2 + N % 10;
};

template<>
struct binary<0>
{
	static const unsigned long value = 0;
};

int main(void)
{
	cout<< binary<0>::value <<endl;
	cout<< binary<1>::value <<endl;
	cout<< binary<10>::value <<endl;
	cout<< binary<11>::value <<endl;
	cout<< binary<10101100>::value <<endl;

	return 0;
}
